package cn.waqwb.s01;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Classname Student
 * @Description TODO
 * @Date 2022/9/8 20:22
 * @Created by Administrator
 */
@Component  //交给spring去创建对象，在容器启动的时候创建
public class Student {
    @Value("张三")
    private String name;
    @Value("22")
    private int age;

    public Student() {
        System.out.println("学生对象的无参构造方法");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
